//
//  HelpViewController.m
//  MedicineBox
//
//  Created by dllo on 15/8/29.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "HelpViewController.h"
#import "DKNightVersion.h"
@interface HelpViewController ()
@property (nonatomic, retain) NSMutableArray *array;
@end

@implementation HelpViewController

-(void)dealloc
{
    [_array release];
    [super dealloc];
}

- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        self.array = [NSMutableArray array];
        NSString *str1 = @" 1.如何查看药品\n   1)可以通过药品分类进行查找\n   2)可以对症找药\n 2.如何搜索药品信息\n   通过药品搜索中输入药名进行药品信息搜索 \n 3.如何设置提醒用药\n   在我的页面点击我的管家,点击右上角闹钟进入设置";
        [self.array addObject:str1];
        
        NSString *str2 = @"   1.百药箱(以下简称本产品)所有信息仅供参考,不做个别的诊断,用药个使用的很据.本产品致力于提供正确,完整的药品咨询,但不保证信息的正确性和完整性,且不对因信息的不正确或遗漏导致的任何损失承担责任.本产品提供的任何资讯仅供参考,不能替代医生或其他医务人员的建议如自行使用本产品发生偏差,本产品一概不负责,衣不负责任何法律责任\n   2.本产仅提供药品展示,不负责药皮的交易,药品交易时发生任何问题与本产品无关,不承担责任\n   3.周边药店地图仅供参考,由于技术问题可能存在偏差";
        [self.array addObject:str2];
        NSString *str3 = @"            本产品是一款简单药类查找软件\n  在您身体不舒服时候为您最快的找到管家为您服务 \n\n\n                            开发者:Luffy";
        [self.array addObject:str3];
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
     self.view.nightBackgroundColor = UIColorFromRGB(0x343434);
    [self createView];
    
   
}

- (void)createView
{
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:[UIScreen mainScreen].bounds];
    imageView.userInteractionEnabled = YES;
    imageView.image = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"2.png" ofType:nil]];
    [self.view addSubview:imageView];
    [imageView release];
#pragma mark -
#pragma mark 设置导航栏
    
    UIView *navView = [[UIView alloc] initWithFrame:CGRectMake(0, 64, self.view.frame.size.width, 0.5)];
    navView.backgroundColor = [UIColor whiteColor];
     navView.nightBackgroundColor = UIColorFromRGB(0x444444);
    [imageView addSubview:navView];
    [navView release];

    UIButton *backButton = [[UIButton alloc] initWithFrame:CGRectMake(10 , 30, 60, 30)];
    [imageView addSubview:backButton];
    [backButton setTitle:@"返回" forState:UIControlStateNormal];
    [backButton setTitleColor:[UIColor orangeColor] forState:UIControlStateNormal];
    [backButton addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside];
    [backButton release];
    
#pragma mark -
#pragma mark 文字Label
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 100, self.view.frame.size.width, self.view.frame.size.height - 200)];
    label.nightTextColor = [UIColor whiteColor];
    [imageView addSubview:label];
    [label release];
    label.numberOfLines = 0;
    if (self.tag == 0) {
        
        NSDictionary *dic1 = @{NSFontAttributeName : [UIFont systemFontOfSize:20],// 字体大小
                               NSForegroundColorAttributeName :[UIColor blackColor]};// 字体颜色
        NSAttributedString *attString1 = [[NSAttributedString alloc] initWithString:[self.array objectAtIndex:self.tag]attributes:dic1];
        label.attributedText = attString1;
    
    }if (self.tag == 1) {
        NSDictionary *dic1 = @{NSFontAttributeName : [UIFont systemFontOfSize:17],// 字体大小
                               NSForegroundColorAttributeName :[UIColor blackColor]};// 字体颜色
        NSAttributedString *attString1 = [[NSAttributedString alloc] initWithString:[self.array objectAtIndex:self.tag]attributes:dic1];
        label.attributedText = attString1;
    }
    if (self.tag == 2) {
        NSDictionary *dic1 = @{NSFontAttributeName : [UIFont systemFontOfSize:17],// 字体大小
                               NSForegroundColorAttributeName :[UIColor blackColor]};// 字体颜色
        NSAttributedString *attString1 = [[NSAttributedString alloc] initWithString:[self.array objectAtIndex:self.tag]attributes:dic1];
        label.attributedText = attString1;
    }

}


- (void)buttonAction:(id)sender
{
    [self dismissViewControllerAnimated:YES completion:nil];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}


@end
